package todo

import (
	jsoniter "github.com/json-iterator/go"
	"github.com/meilihao/golib/v2/log"
	"go.uber.org/zap"
)

var (
	json = jsoniter.ConfigCompatibleWithStandardLibrary
)

func ToJson(t interface{}) string {
	d, err := json.Marshal(t)
	if err != nil {
		log.Glog.Fatal("ToJson", zap.Error(err))
	}

	return string(d)
}
